(function() {
    //DsNav
    function DsNav(opt) {
        if (!opt || _.isEmpty(opt)) {
            console.log("112233");
            return;
        }
        this.$vue = opt.$vue || {};
        this.treeData = opt.treeData || []; //导航栏数据
        this.settings = $.extend({
                //参数
                itemName: "title",
                menuWrapClass: ".ds-navList-wrap", //菜单容器选择器
                menuParentClass: ".ds-navList-template", //
                menuClass: ".ds-navList", //menu类名
                itemClass: ".ds-navList-item", //item类名
                hasIcon: false, //图标
                iconSrc: "iconSrc", //图标链接的字段名
                activeIconSrc: "activeIconSrc", //选中时的图标链接字段名
                iconClass: ".icon", //图标类名
                hasArrow: false, //箭头图标
                arrowSrc: "arrowSrc", //箭头链接的字段名
                activeArrowSrc: "activeArrowSrc", //选中时的箭头链接的字段名
                arrowClass: ".arrow", //箭头类名
                tabName: "route", //切换项对应的字段
                activeClass: ".is-active", //item选中时的类名
                toggleClass: "sider-toggle", //菜单折叠时的类名
                scrollClass: "ds-scroll", //菜单滚动条类名
                posTop:50, // 定位距离顶部的距离
                pdv:10  // 导航栏父级内边距
            },
            opt.settings || {}
        );
        this.fns = {
            //事件
            itemClickAfter: $.isFunction(opt.itemClickAfter) ?
                opt.itemClickAfter :
                $.noop, //点击菜单项
            itemIconChange: $.isFunction(opt.itemIconChange) ?
                opt.itemIconChange :
                $.noop, //icon的src修改
            itemArrowChange: $.isFunction(opt.itemArrowChange) ?
                opt.itemArrowChange :
                $.noop //arrow的src修改
        };
        this.tempHtml = ""; //dom字符串
        this.navListWrap = null; //导航栏的容器
        this.listWrapTemp = null; // 导航栏父级
        this.listWrap = null; //导航栏
        this.symbolReg = /\-/g; //检查-符号
        this.indexArrOfItem = null; //每个子项对应的index标记-数组
        this.openIndex = 1; //展开对应菜单时要添加active类名元素的初始下标
        this.clickedControl = false; //点击控制
        // 滚动距离--竖向滚动条
        this.NLWH = 0;
        this.LWH = 0;
        this.NLWST = 0;
        this.zzHeaderH = 0;
        this.stepDis = 0;
    }
    DsNav.prototype = {
        constructor: DsNav,
        listWrap: '<div class="ds-navList"></div>',
        common:{
            iconSrcLink:"https://lijiek700c.github.io/images/qian.jpg",
            activeIconSrc:"https://lijiek700c.github.io/images/qian.jpg",
            arrowSrcLink:"./images/sideBar/fj-sider-arrow.png",
            activeArrowSrcLink:"./images/sideBar/fj-sider-arrow1.png"
        },
        // 修改location.href对应切换的路径
        refreshLocationHref:function(path){
            //console.log("---zz-old-iframes-path---",$.cookie("zz-old-iframes-path"));
            var newPath = path.replace(/\//g,"");
            // window.top
            var wt = window.top;
            var location___url = wt.location.href;
            var location___url___search = wt.location.search;
            var search___arr = location___url___search?location___url___search.slice(1).split("="):[];
            //
            if(!location___url___search || newPath!==search___arr[0]){
                location___url = location___url.replace(/(\?\w+)/g,"");
                var mr = (""+ Math.random()*10).replace(/\./g,"");
                // 存path
                $.cookie("zz-old-iframes-path",path);
                // 修改href
                wt.location.hash = "?"+newPath+"="+mr;
            }
        },
        // 获取竖向滚动的相关值
        getVerticalValues:function(){
            this.NLWH = this.navListWrap.outerHeight();
            this.LWH = this.listWrapTemp.outerHeight();
            this.NLWST = (this.LWH - this.NLWH) < 0 ? 0 : (this.LWH - this.NLWH);
            console.log("---this.navListWrap.height---",this.NLWH);
            console.log("---this.listWrapTemp.height---",this.LWH);
            console.log("---this.listWrapTemp.st---",this.NLWST);
        },
        // 设置listWrapTemp上下滑动
        listWrapTempSlide(dis){
            this.listWrapTemp.css("transform","translateY("+dis+"px)");
        },
        //
        init: function() {
            if (!this.treeData.length) {
                console.warn("没有数据");
                return;
            }
            //_.template设置
            _.templateSettings = {
                interpolate: /\{\{(.+?)\}\}/g
            };
            //创建导航栏
            this.initMenu();
            return this;
        },
        refreshMenu: function(menuData) {
            //重新创建菜单
            if (!menuData || !_.isArray(menuData)) {
                alert("没有菜单数据");
                return;
            }
            if (this.listWrap && this.navListWrap) {
                this.clearItemsEvents();
                this.FLMenuItem = null;
                this.listWrap.parent().empty();
                this.listWrap = null;
                this.treeData = null;
                this.treeData = menuData;
                //
                this.initMenu();
            }
        },
        initMenu: function() {
            if (_.isArray(this.treeData) && this.treeData.length) {
                //过滤数据
                //var tmpTreeData = this.filterTreeData(this.treeData);
                //this.treeData = null;
                //this.treeData = tmpTreeData;
                //console.log(this.treeData);
                //创建菜单并绑定事件
                this.listWrap = $(this.createMenu(this.treeData));
                //
                this.constructor.prototype.menuClass = this.settings.menuClass;
                this.constructor.prototype.activeClassName = this.settings.activeClass.slice(
                    1
                );
                //
                var NLW = $(this.settings.menuWrapClass, "body");
                this.navListWrap = NLW.length > 0 ? NLW : null;
                this.listWrapTemp = this.navListWrap.find(this.settings.menuParentClass);
                this.listWrapTemp.append(this.listWrap);
                // 获取竖向滚动的相关值
                this.getVerticalValues();
                //设置事件
                this.setItemsEvents();
            } else {
                alert("没有菜单数据");
            }
        },
        filterTreeData: function(data) { //过滤掉数据中hasRemoved=true的选项
            var self = this;
            data = $.grep(data, function(item) {
                //console.log(item);
                if (item.children && $.isArray(item.children) && item.children.length) {
                    item.children = self.filterTreeData(item.children);
                }
                return !item.hasRemoved;
            });
            return data;
        },
        createMenu: function(data, key) {
            //创建导航栏
            if ((_.isArray(data) && !data.length) || !_.isArray(data)) {
                return "";
            }
            var key = key || "";
            var tempHtmlArr = [];
            for (var i = 0; i < data.length; i++) {
                var dataItem = data[i];
                var keyIndex = key ? key + "-" + (i + 1) : i + 1 + "";
                dataItem.index = keyIndex; //数据项添加子级index标记
                tempHtmlArr.push(this.createMenuItem(dataItem, keyIndex));
            }
            return '<div class="ds-navList">' + tempHtmlArr.join("") + "</div>";
        },
        createMenuItem: function(data, key) {
            //创建导航栏子项
            var tempItemHtmlArr = [];
            var nl = key.search(this.symbolReg) != -1 ? "x" : "1"; //是否是第一级菜单
            var styleStr = data.hasRemoved ? "display:none;" : "";
            tempItemHtmlArr.push(
                _.template(
                    '<div class="ds-navList-item" style="' + styleStr + '" data-level="' +
                    nl +
                    '" data-index="' +
                    key +
                    '" data-'+this.settings.tabName+'="' +
                    this.setItemTabName(data) +
                    '">' +
                    this.createIconTemp(data, nl) +
                    '<span class="item-tag" title="{{data.' +
                    this.settings.itemName +
                    '}}">{{data.' +
                    this.settings.itemName +
                    "}}</span>" +
                    this.createArrowTemp(data, nl) +
                    "</div>" +
                    this.createMenu(data.children||[], key), { variable: "data" }
                )(data)
            );
            return tempItemHtmlArr.join("");
        },
        setItemTabName(data) {
            //给子项标签设置data-route属性
            return data[this.settings.tabName] ? data[this.settings.tabName] : "";
        },
        createIconTemp: function(data, flag) {
            var iconSrcLink = data[this.settings.iconSrc]?data[this.settings.iconSrc]:this.common.iconSrcLink;
            var activeIconSrcLink = data[this.settings.activeIconSrc]?data[this.settings.activeIconSrc]:this.common.activeIconSrcLink;
            return this.settings.hasIcon && flag == 1 ?
                '<img class="icon" src="' +
                iconSrcLink +
                '" data-noselect="' +
                iconSrcLink +
                '" data-select="' +
                activeIconSrcLink +
                '" alt="icon">' :
                "";
        },
        createArrowTemp: function(data, flag) {
            var arrowSrcLink = data[this.settings.arrowSrc]?data[this.settings.arrowSrc]:this.common.arrowSrcLink;
            var activeArrowSrcLink = data[this.settings.arrowSrc]?data[this.settings.arrowSrc]:this.common.activeArrowSrcLink;
            /* data.children */
            var dc = data.children || [];
            return ( this.settings.hasArrow && flag == 1 && dc.length) ?
                '<img class="arrow" src="' +
                arrowSrcLink +
                '" data-noselect="' +
                arrowSrcLink +
                '" data-select="' +
                activeArrowSrcLink +
                '" alt="arrow">' :
                "";
        },
        getIndexArr: function(item) {
            //获取子项对应的层级标记-数组
            var dataIndex = item.attr("data-index");
            return dataIndex.split(this.symbolReg);
        },
        getItemData: function(navDatas, arr) {
            //获取子项对应的数据
            //console.log(arr);
            var index = parseInt(arr.shift()) - 1;
            var tmpData = navDatas[index];
            return arr.length == 0 ? tmpData : this.getItemData(tmpData.children, arr);
        },
        //获取与index对应的各项数据(按照层级顺序)
        getMatchedItemsByIndex: function(index) {
            //console.log("---index---",index); 
            var tmpArr = /\-/g.test(index) ? index.split("-") : [index];
            var results = [];
            //
            getName.call(this, this.treeData, tmpArr);
            //
            function getName(data, arr) {
                if (!arr.length || !data) return;
                var dataItem = data[arr.shift() * 1 - 1];
                //results.push(dataItem[this.settings.itemName]);
                var cloneDataItem = {};
                for (const key in dataItem) {
                    if (dataItem.hasOwnProperty(key)) {
                        if(!_.isArray(dataItem[key])){
                            cloneDataItem[key] = dataItem[key];
                        }else{
                            cloneDataItem[key] = dataItem[key].length;
                        }
                    }
                }
                results.push(cloneDataItem);
                //var children = dataItem.children && _.isArray(dataItem.children) ? dataItem.children : [];
                //console.log("---dataItem---",dataItem);
                //
                getName.call(this, dataItem.children, arr);
            }
            return results;
        },
        navItemIsActive: function() {
            //是否有is-active类名
            return this.hasClass(DsNav.prototype.activeClassName);
        },
        navItemRemoveClass: function() {
            //删除类名
            this.removeClass(DsNav.prototype.activeClassName);
        },
        navItemAddClass: function() {
            //添加类名
            this.siblings()
                .removeClass(DsNav.prototype.activeClassName)
                .end()
                .addClass(DsNav.prototype.activeClassName);
        },
        navItemListHide: function() {
            //隐藏菜单
            return this.stop(true, true)
                .slideUp(200)
                .promise();
        },
        navItemListShow: function() {
            //显示菜单
            return this.stop(true, true)
                .slideDown(200)
                .promise();
        },
        // 是不是菜单元素
        isNavList: function() {
            //是否是菜单
            return this.is(DsNav.prototype.menuClass);
        },
        // 根据1级菜单列表的收起展开计算竖向滚动距离
        recalcVerticalValues(navItem){
            var level = navItem.attr("data-level");
            if(level != 1)return false;
            //alert("10086___recalcVerticalValues");
            //
            this.getVerticalValues();
            //
            var offsetInfo =  navItem.offset();
            console.info("---navItem.offset()---",offsetInfo);
            var realTop = offsetInfo.top - this.settings.posTop;
            // 有滚动距离
            if( this.NLWST > 0 ){
                if( realTop <= this.NLWST ) {
                    this.stepDis = 0;
                } else {
                    // realTop / this.LWH = x / this.NLWST;
                    this.stepDis = Math.round((realTop / this.NLWH)*this.NLWST)*-1;
                }
                this.listWrapTempSlide(this.stepDis);
            }
        },
        // 菜单收起<->展开
        toggleItemMenu: function(navItem) {
            var _self = this;
            //var level = navItem.attr("data-level");
            //展开子项的菜单
            var itemNavList = navItem.next(); //对应的菜单
            if (this.navItemIsActive.call(navItem)) {
                if (this.isNavList.call(itemNavList)) {
                    this.navItemRemoveClass.call(navItem);
                    //收起菜单
                    this.navItemListHide.call(itemNavList).then(function(){
                        // 1级菜单项
                        _self.recalcVerticalValues(navItem);
                    });
                }
            } else {
                this.navItemAddClass.call(navItem);
                if (this.isNavList.call(itemNavList)) {
                    //展开菜单
                    this.navItemListShow.call(itemNavList).then(function() {
                        var posInfo = navItem.get(0).getBoundingClientRect(),
                            posInfo2 = navItem
                            .parent()
                            .get(0)
                            .getBoundingClientRect(),
                            indexInfo = _self.getIndexArr(navItem);
                        if (indexInfo.length >= 2) {
                            itemNavList.css({
                                top: posInfo.top - posInfo.height - posInfo2.top + "px"
                            });
                        }
                        // 1级菜单项
                        _self.recalcVerticalValues(navItem);
                    });
                }
            }
        },
        //收起菜单
        hideOhterNavItemLists: function(navItems) {
            //隐藏其它子项的菜单
            _.each(
                navItems,
                _.bind(function(e, i) {
                    this.hideNavItemList($(e));
                }, this)
            );
        },
        hideNavItemList: function(navItem, noDeep) {
            var _self = this;
            //隐藏
            var oList = navItem.next();
            //清掉被选中的类名
            this.navItemRemoveClass.call(navItem);
            //是菜单的时候
            if (this.isNavList.call(oList)) {
                this.navItemListHide.call(oList).then(function(){
                    //隐藏子级下的菜单
                    !noDeep &&
                        _self.hideOhterNavItemLists(oList.children(_self.settings.itemClass));
                });
            }
        },
        //获取第1级菜单元素
        getFLMenuItem: function() {
            if (!this.FLMenuItem) {
                this.FLMenuItem = this.listWrap.children(
                    this.settings.itemClass + "[data-level=1]"
                );
            }
        },
        //收起不是当前active菜单项的所有其它菜单--点击菜单项
        toggleUpListByLevelX: function(item) {
            this.getFLMenuItem();
            var indexArr2 = this.getIndexArr(item);
            //收起同级的其它所有子项菜单
            this.hideOhterNavItemLists(item.siblings(this.settings.itemClass));
            this.hideOhterNavItemLists(
                this.FLMenuItem.not("[data-index=" + indexArr2[0] + "]")
            );
        },
        //收起不是当前active菜单项所有其它1级菜单--点击菜单项
        toggleUpListByLevel1: function(item) {
            item.siblings(this.settings.itemClass).each(
                $.proxy(function(i, e) {
                    this.hideNavItemList($(e), true);
                }, this)
            );
        },
        //展开菜单
        openNavMenu: function(tabName) {
            //?
            if (/\?/.test(tabName)) {
                tabName = tabName.slice(0, tabName.indexOf("?"));
            }
            //根据tabName展开对应的菜单
            //第1级菜单元素
            this.getFLMenuItem();
            //找出对应的菜单数据
            var matchedData, index;
            var indexInfo = this.getDataOfTabName(this.treeData, tabName);
            //console.log("---indexInfo---",indexInfo);
            //找到对应的数据
            if (_.isNumber(indexInfo.index)) {
                this.clearItemsEvents();
                //收起已展开的菜单
                this.hideOhterNavItemLists(this.FLMenuItem);
                //是不是已经展开的菜单  ???
                var openedItem = this.FLMenuItem.filter(this.settings.activeClass);
                if (openedItem.length) {
                    var indexArr = this.getIndexArr(openedItem);
                    var openedItemData = this.getItemData(this.treeData, indexArr);
                    //已展开的子项-图标
                    this.fns.itemIconChange.apply(this, [openedItem, openedItemData, true]);
                    //已展开的子项-箭头
                    this.fns.itemArrowChange.apply(this, [
                        openedItem,
                        openedItemData,
                        true
                    ]);
                }
                //是不是二级菜单之后的菜单
                /* if (this.navListWrap.hasClass(this.settings.toggleClass)) {
                    this.navListWrap.removeClass(this.settings.scrollClass);
                } else {
                    if (this.indexArrOfItem.length > 2) {
                        this.navListWrap.removeClass(this.settings.scrollClass);
                    } else {
                        this.navListWrap.addClass(this.settings.scrollClass);
                    }
                } */
                //展开对应的子项
                this.openIndex = this.indexArrOfItem.length > 1 ? 1 : 0;
                //???
                this.openNavItemList(this.FLMenuItem.eq(indexInfo.index));
                _.delay($.proxy(this.setItemsEvents, this), 200);
                //console.log(this.indexArrOfItem);
                //console.log(this.treeData[index]);
            } else {
                //alert("导航路径不存在");
            }
            return indexInfo.pathIndex?indexInfo.pathIndex:"";
        },
        getDataOfTabName: function(data, tabName) {
            //获取要展开项的对应数据
            var index;
            this.indexArrOfItem = null;
            for (var i = 0, len = data.length; i < len; i++) {
                var item = data[i];
                var children = (item.children&&_.isArray(item.children))?item.children:[];
                // if (!_.isArray(item.children)) {
                //     alert("菜单数据的children项不是数组");
                //     break;
                // }
                if (item[this.settings.tabName] == tabName && !children.length) {
                    this.indexArrOfItem =
                        item.index.search(this.symbolReg) != -1 ?
                        item.index.split("-") :
                        [item.index];
                    index = i;
                    pathIndex = item.index;
                    break;
                }
                if (item[this.settings.tabName] != tabName && children.length) {
                    if (this.hasTabName(children, tabName)) {
                        index = i;
                        //pathIndex = item.index;
                        break;
                    }
                }
            }
            return index !== undefined ? {
                index: index,
                pathIndex: this.indexArrOfItem.join("-")
            } : {};
        },
        hasTabName: function(data, tabName) {
            var dataIsArray = _.isArray(data);
            if (!dataIsArray) return false;
            var result = false;
            for (var i = 0, len = data.length; i < len; i++) {
                var item = data[i];
                if (item[this.settings.tabName] == tabName) {
                    //matched
                    //console.log(item[this.settings.tabName]);
                    this.indexArrOfItem =
                        item.index.search(this.symbolReg) != -1 ?
                        item.index.split("-") :
                        [item.index];
                    result = true;
                    break;
                } else {
                    //console.log("tabName in children");
                    result = this.hasTabName(item.children, tabName);
                    if (result) {
                        break;
                    }
                }
            }
            return result;
        },
        openNavItemList: function(item) {
            //展开
            var openIndex = this.indexArrOfItem[this.openIndex] * 1;
            if (!this.indexArrOfItem || !openIndex){
                // 获取竖向滚动的相关值
                this.getVerticalValues();
                return;
            }
            var level = item.attr("data-level");
            //console.log("---level---",level);
            this.navItemAddClass.call(item);
            if (level == 1) {
                var indexArr = this.getIndexArr(item);
                var itemData = this.getItemData(this.treeData, indexArr);
                //已展开的子项-图标
                this.fns.itemIconChange.apply(this, [item, itemData, false]);
                //已展开的子项-箭头
                this.fns.itemArrowChange.apply(this, [item, itemData, false]);
            }
            var oList = item.next();
            if (this.isNavList.call(oList)) {
                this.navItemListShow.call(oList).then($.proxy(function(){
                    // 1级菜单项
                    this.recalcVerticalValues(item);
                    //要添加avctive类名的
                    var activeItem = oList
                        .children(this.settings.itemClass)
                        .eq(openIndex - 1);
                    this.toggleItemMenu(activeItem);
                    //有下级菜单显示
                    this.openIndex++;
                    //展开后面的子级菜单
                    this.openNavItemList(activeItem);
                },this));
            }
        },
        clearIconSrc: function(icon) {
            //icon图标恢复成默认的src
            icon.attr("src", icon.attr("data-noselect"));
        },
        clearArrowSrc: function(arrow) {
            //箭头图标恢复成默认的src
            arrow.attr("src", arrow.attr("data-noselect"));
        },
        navListWrapScroll: function(item) {
            //导航容器切换scroll类名
            var listItems;
            var indexArr2 = this.getIndexArr(item);
            if (this.navListWrap.hasClass(this.settings.toggleClass)) {
                if (indexArr2.length <= 1) {
                    var nextIsList = this.isNavList.call(item.next()),
                        isActive = this.navItemIsActive.call(item);
                    nextIsList && isActive ?
                        this.navListWrap.removeClass(this.settings.scrollClass) :
                        this.navListWrap.addClass(this.settings.scrollClass);
                }
            } else {
                if (indexArr2.length <= 1) {
                    listItems = this.getNextListChildren(item);
                    this.navItemIsActive.call(listItems) ?
                        this.navListWrap.removeClass(this.settings.scrollClass) :
                        this.navListWrap.addClass(this.settings.scrollClass);
                } else {
                    var nextIsList = this.isNavList.call(item.next());
                    nextIsList && this.navListWrap.removeClass(this.settings.scrollClass);
                }
            }
        },
        getNextListChildren: function(navItem) {
            //获取菜单子元素
            return navItem.next().children(this.settings.itemClass);
        },
        getActiveNavItem: function(navItems, IA) {
            //获取菜单中有active类名的菜单项
            var activeNavItem;
            var index = IA.shift() * 1 - 1;
            activeNavItem = navItems.eq(index);
            if (!IA.length) {
                return activeNavItem;
            }
            var nextList = activeNavItem.next();
            if (IA.length && this.isNavList.call(nextList)) {
                return this.getActiveNavItem(
                    nextList.children(this.settings.itemClass),
                    IA
                );
            }
        },
        setWrapEleZindex: function() {
            //重新设置导航栏的层级
            if (this.navListWrap.attr("style")) return;
            var zArr = this.navListWrap
                .siblings()
                .addBack()
                .map(function(i, item) {
                    return $(item).css("z-index");
                })
                .get();
            for (var i = 0, z;
                (z = zArr[i++]);) {
                if (z == "auto") {
                    z = 0;
                }
                z = z * 1;
            }
            var maxZ = Math.max.apply(null, zArr);
            this.navListWrap.css("z-index", maxZ + 1);
        },
        deleteWrapEleStyle: function() {
            //删除导航栏style
            this.navListWrap.removeAttr("style");
        },
        clearItemsEvents: function() {
            //解绑导航栏子项事件
            this.listWrap.off("click", this.settings.itemClass);
            this.navListWrap.siblings().off("click");
        },
        /**
         * @description: 
         * @param {*}
         * @return {*}
         */
        setItemsEvents: function() {
            //绑定导航栏事件
            this.listWrap.off("click").on(
                "click",
                this.settings.itemClass,
                $.proxy(function(ev) {
                    if (this.clickedControl) return false;
                    this.clickedControl = true;
                    //
                    //console.time("test");
                    //
                    var _this = $(ev.currentTarget);
                    var type = _this.attr("data-level");
                    //获取子项对应的层级标记-数组
                    var indexArr = this.getIndexArr(_this);
                    console.log("---indexArr---",indexArr);
                    //是否有子级菜单
                    var isList = this.isNavList.call(_this.next());
                    //是否有is-active类名
                    var isActive = this.navItemIsActive.call(_this);
                    //获取子项对应的数据
                    var matchedData = this.getItemData(this.treeData, indexArr);
                    //console.log("---matchedData---", matchedData);
                    //操作图标和箭头收起其它菜单
                    if (type == 1) {
                        // 1级菜单
                        this.fns.itemIconChange.apply(this, [_this, matchedData, isActive]);
                        this.fns.itemArrowChange.apply(this, [_this, matchedData, isActive]);
                        if ($.isArray(matchedData.children) && matchedData.children.length) {
                            //第一级菜单-只收起同级的第一级菜单
                            this.toggleUpListByLevel1(_this);
                        } else {
                            this.toggleUpListByLevelX(_this);
                        }
                    } else {
                        this.toggleUpListByLevelX(_this);
                    }
                    //展开或收起对应菜单
                    this.toggleItemMenu(_this);
                    //导航容器切换scroll类名
                    //this.navListWrapScroll(_this);
                    /* if(this.getIndexArr(_this).length >= 2){
                        this.navListWrap.removeClass(this.settings.scrollClass);
                    }else{
                        this.navListWrap.addClass(this.settings.scrollClass);
                    } */
                    //重新设置导航栏的层级
                    // var ziia;
                    // if (this.navListWrap.hasClass(this.settings.toggleClass)) {
                    //     ziia = this.getIndexArr(_this);
                    //     if (ziia.length > 0 && isList) {
                    //         this.setWrapEleZindex();
                    //     }
                    //     if (ziia.length == 1 && isList && !this.navItemIsActive.call(_this)) {
                    //         this.deleteWrapEleStyle();
                    //     }
                    // } else {
                    //     ziia = this.getIndexArr(_this);
                    //     if (ziia.length > 0 && isList) {
                    //         this.setWrapEleZindex();
                    //     }
                    //     if (ziia.length == 2 && isList && !this.navItemIsActive.call(_this)) {
                    //         this.deleteWrapEleStyle();
                    //     }
                    // }
                    //触发点击后的方法 ->
                    if (!isList && !isActive) {
                        //this.deleteWrapEleStyle();
                        this.fns.itemClickAfter.call(this, matchedData);
                        var indexArr2 = this.getIndexArr(_this),
                            FLItem = this.FLMenuItem.eq(indexArr2[0] * 1 - 1);
                        // 菜单是否折叠
                        if (this.navListWrap.hasClass(this.settings.toggleClass)) {
                            if (indexArr2.length >= 2) {
                                var IA = this.getIndexArr(FLItem);
                                var matchedData = this.getItemData(this.treeData, IA);
                                this.fns.itemIconChange.apply(this, [FLItem, matchedData, true]);
                                this.fns.itemArrowChange.apply(this, [FLItem, matchedData, true]);
                                //
                                this.toggleItemMenu(FLItem);
                            }
                        } else {
                            if (indexArr2.length >= 3) {
                                var sActiveItem = this.getActiveNavItem(
                                    this.FLMenuItem,
                                    indexArr2.splice(0, 2)
                                );
                                this.toggleItemMenu(sActiveItem);
                            }
                        }
                    }
                    //clickedControl
                    this.clickedControl = false;
                    //
                    //console.timeEnd("test");
                }, this)
            );
            //取消导航栏层级设置
            this.navListWrap.parent().siblings()
                .off("click")
                .on(
                    "click",
                    $.proxy(function(ev) {
                        alert("10086");
                        //ev.stopPropagation();
                        if (this.FLMenuItem) {
                            var FLactive = this.FLMenuItem.filter(this.settings.activeClass);
                            if (!FLactive.length) return false;
                            if (this.navListWrap.hasClass(this.settings.toggleClass)) {
                                var indexArr = this.getIndexArr(FLactive);
                                var matchedData = this.getItemData(this.treeData, indexArr);
                                FLactive.removeClass(this.settings.activeClass.slice(1));
                                this.fns.itemIconChange.apply(this, [
                                    FLactive,
                                    matchedData,
                                    true
                                ]);
                                this.fns.itemArrowChange.apply(this, [
                                    FLactive,
                                    matchedData,
                                    true
                                ]);
                            } else {
                                var nac = this.getNextListChildren(FLactive).filter(
                                    this.settings.activeClass
                                );
                                if (nac.length && this.isNavList.call(nac.next())) {
                                    this.toggleItemMenu(nac);
                                }
                            }
                        }
                        //this.deleteWrapEleStyle();
                    }, this)
                );
            // 导航栏容器的滚轮事件
            this.navListWrap.off("mousewheel").on("mousewheel",_.debounce($.proxy(function(e){
                console.log("---navListWrap__mousewheel---",e.originalEvent);
                this.navListWrapScrollFn(e,"deltaY",function(deltaY){
                    return Math.abs(deltaY)/10;
                });
            },this),16));
            //
            this.navListWrap.off("DOMMouseScroll").on("DOMMouseScroll",_.debounce($.proxy(function(e){
                console.log("---navListWrap__DOMMouseScroll---",e.originalEvent);
                this.navListWrapScrollFn(e,"detail",function(deltaY){
                    return Math.abs(deltaY)*3;
                });
            },this),16));
        },
        // 导航栏滚动
        navListWrapScrollFn:function(e,propName,fn){
            var deltaY = e.originalEvent[propName];
            //var stepY = Math.abs(deltaY)/10;
            //Math.abs(deltaY)/10
            var stepY = fn && fn(deltaY);
            //console.log("---stepY---",stepY);
            // 向下滚动
            if( deltaY > 0 ){
                //console.log("---向下滚动---",(stepY*-1));
                if(Math.abs(this.stepDis)>=this.NLWST){
                    this.stepDis = this.NLWST*-1;
                    this.listWrapTempSlide(this.stepDis);
                    return false;
                }
                this.stepDis+=(stepY*-1);
            }
            // 向上滚动
            if( deltaY < 0 ){
                //console.log("---向上滚动---",stepY);
                if(this.stepDis>=0){
                    this.stepDis = 0;
                    this.listWrapTempSlide(this.stepDis);
                    return false;
                }
                this.stepDis+=stepY;
            }
            //this.listWrapTemp.css("transform","translateY("+this.stepDis+"px)");
            this.listWrapTempSlide(this.stepDis);
        }
    };
    window.zzSideBar = DsNav;
})();